﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace LXYYY.Migrations
{
    public partial class lxyyy : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "MyGoodsImg",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ImgUrl = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ImgMastreMap = table.Column<int>(type: "int", nullable: false),
                    ImgType = table.Column<int>(type: "int", nullable: false),
                    PrimaryId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MyGoodsImg", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MyGoodsInformation",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InformationName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MyProperty = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InformationDisplay = table.Column<int>(type: "int", nullable: false),
                    InformationSaleBegin = table.Column<DateTime>(type: "datetime2", nullable: false),
                    InformationSalePrice = table.Column<int>(type: "int", nullable: false),
                    InformationSPromotion = table.Column<int>(type: "int", nullable: false),
                    InformationDetaile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InformationWeight = table.Column<int>(type: "int", nullable: false),
                    InformationFreight = table.Column<int>(type: "int", nullable: false),
                    InformationStata = table.Column<int>(type: "int", nullable: false),
                    InformationBorwseNum = table.Column<int>(type: "int", nullable: false),
                    InformationSaleNum = table.Column<int>(type: "int", nullable: false),
                    InformationEvaluaNum = table.Column<int>(type: "int", nullable: false),
                    InformationSpecild = table.Column<int>(type: "int", nullable: false),
                    InformationTypeId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MyGoodsInformation", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MyGoodsInventory",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InventoryPrice = table.Column<int>(type: "int", nullable: false),
                    InventoryNumber = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MyGoodsInventory", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MyGoodsSpecifications",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SpecificationsName = table.Column<int>(type: "int", nullable: false),
                    SpecificationsOrder = table.Column<int>(type: "int", nullable: false),
                    SpecificationsDIsplay = table.Column<int>(type: "int", nullable: false),
                    SpecificationsTypeId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MyGoodsSpecifications", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MyGoodsType",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodsTypeParentId = table.Column<int>(type: "int", nullable: false),
                    GoodsTypeAlias = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodsTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodsTypeOrder = table.Column<int>(type: "int", nullable: false),
                    GoodsTypeDisplay = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MyGoodsType", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MyUserAddr",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AddrName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddrOrder = table.Column<int>(type: "int", nullable: false),
                    AddrPId = table.Column<int>(type: "int", nullable: false),
                    AddrDefault = table.Column<int>(type: "int", nullable: false),
                    AddrStata = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MyUserAddr", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MyUserConsumption",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ConsumptionCTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    MemberID = table.Column<int>(type: "int", nullable: false),
                    SumMoney = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    OrderNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Amount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    payable = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    OrderStata = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MyUserConsumption", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MyUserInformation",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InformationPassword = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InformationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InformationNIckName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InformationAccount = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InformationName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InformationSex = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InformationPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InformationIntegral = table.Column<int>(type: "int", nullable: false),
                    InformationStata = table.Column<int>(type: "int", nullable: false),
                    InformationBalace = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MyUserInformation", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MyUserMembers",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MembersName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MembersDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MembersGrowth = table.Column<int>(type: "int", nullable: false),
                    MembersDiscount = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MyUserMembers", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MyUserPay",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodsId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Money = table.Column<int>(type: "int", nullable: false),
                    PayType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PayStata = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MyUserPay", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Power",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PowerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PowerDesc = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Power", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Role",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RoleName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RoleDesc = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Role", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "RolePower",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RoleID = table.Column<int>(type: "int", nullable: false),
                    PowerID = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RolePower", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "UserInfos",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserInfoName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserInfoPwd = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserInfoChineseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserInfoSex = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserInfoPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserInfoMailbox = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserInfoRemarks = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfos", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "UserRole",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserID = table.Column<int>(type: "int", nullable: false),
                    RoleID = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserRole", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "MyGoodsImg");

            migrationBuilder.DropTable(
                name: "MyGoodsInformation");

            migrationBuilder.DropTable(
                name: "MyGoodsInventory");

            migrationBuilder.DropTable(
                name: "MyGoodsSpecifications");

            migrationBuilder.DropTable(
                name: "MyGoodsType");

            migrationBuilder.DropTable(
                name: "MyUserAddr");

            migrationBuilder.DropTable(
                name: "MyUserConsumption");

            migrationBuilder.DropTable(
                name: "MyUserInformation");

            migrationBuilder.DropTable(
                name: "MyUserMembers");

            migrationBuilder.DropTable(
                name: "MyUserPay");

            migrationBuilder.DropTable(
                name: "Power");

            migrationBuilder.DropTable(
                name: "Role");

            migrationBuilder.DropTable(
                name: "RolePower");

            migrationBuilder.DropTable(
                name: "UserInfos");

            migrationBuilder.DropTable(
                name: "UserRole");
        }
    }
}
